<template>
    <view class="form">
        <uni-forms ref="form" :rules="rules" :modelValue="formData">
            <uni-forms-item label="标题" name="title">
                <uni-easyinput type="text" v-model="formData.title" placeholder="请输入标题" />
            </uni-forms-item>
			<uni-forms-item label="作者" name="createUserName">
			    <uni-easyinput type="text" v-model="formData.author" placeholder="请输入作者" />
			</uni-forms-item>
			<uni-forms-item label="单位" name="company">
			    <uni-easyinput type="text" disabled v-model="company" placeholder="请输入单位" />
			</uni-forms-item>
			<uni-forms-item label="内容" name="company">
			    <uni-easyinput type="textarea"  v-model="formData.content" placeholder="请输入内容" />
			</uni-forms-item>
			<uni-forms-item label="缩略图" name="company">
			   <uni-file-picker 
			       v-model="imageValue" 
			       fileMediatype="image" 
			       mode="grid" 
			       @select="select" 
			       @progress="progress" 
			       @success="success" 
			       @fail="fail" 
			   />
			</uni-forms-item>
        </uni-forms>
        <view style="margin: 16px">
        	<van-button round block type="info" @click="submit"> 确定 </van-button>
        </view>
    </view>
</template>

<script>
	export default {
		data() {
			return {
				formData:{
					companyId:16,//单位ID--正式16
					from:'bjwj',//系统标识
					sign:'',//签名
					timestamp:'',//时间戳
					userID:'',
					title:'',//标题
					// abstract:'',//摘要
					thumbnail:'11',//文章缩略图
					author:'',//作者
					content:'',//文章内容
					thirdAccounts:''//ID
				},
				company:'北京武警总队',
				rules:{},
				imageValue:[],
				obj:''
			}
		},
		methods: {
			
		},
		onLoad(content){
			console.log(content,'onload')
			for(let i in content){
				console.log(i)
			}
			// JSON.stringify(i)
			
			// this.formData.title=content
		},
		onReady(){
			this.$refs.form.setRules(this.rules)
		},
		onShow(){
			uni.$on("changeContent",function(re){
				console.log('jianting'.re)
			})
		}
	}
</script>

<style scoped>
.form {
		padding: 10px;
	}
</style>
